package com.heima.minio;

import io.minio.MinioClient;
import lombok.Getter;
import lombok.Setter;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Getter
@Setter
@Configuration
@ConfigurationProperties(prefix = "minio")
public class MinIoConfig {

    private String accessKey;
    private String secretKey;
    private String endpoint;

    @Bean
    public MinioClient getMinioClient() {
        return MinioClient.builder().credentials(accessKey, secretKey).endpoint(endpoint).build();
    }
}
